﻿using System;
using System.Collections.Generic;
using System.Text;
using Axis.Dao.Base;
using Axis.BusinessObject.Core;
using Axis.BusinessObject.Order;
using FWS.Framework.Log;
using Axis.Dao.SQL;

namespace Axis.Dao.Order
{
    public class COrderDao : CDaoBase   
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pInputValue"> 
        /// <InputValue UserID="1" ID="1" />
        /// Neu lay theo danh sach thi ko co ID
        /// </param>
        /// <returns></returns>
        public IList<COrderList> GetOrderList(string pInputValue)
        {
            try
            {
                COutputValue output = new COutputValue();
                IList<COrderList> list = CallFunctionWithList<COrderList>(CSystemFunction.GetOrderList, pInputValue, ref output);
                LastOutputValue = output;

                return list;
            }
            catch (Exception ex)
            {
                CLogManager.WriteDAL("GetCustomer", ex.Message);
                return null;
            }
        }


        public IList<COrderDetail> GetOrderListDetail(string pInputValue)
        {
            try
            {
                COutputValue output = new COutputValue();
                IList<COrderDetail> list = CallFunctionWithList<COrderDetail>(CSystemFunction.GetOrderListDetail, pInputValue, ref output);
                LastOutputValue = output;

                return list;
            }
            catch (Exception ex)
            {
                CLogManager.WriteDAL("GetCustomer", ex.Message);
                return null;
            }
        }
        /// <summary>
        /// <InputValue UserID="" Session="" Action="INSERT|UPDATE|DELETE" Title="" Summary="" Content="" />
        /// </summary>
        /// <param name="pInputValue">
        /// </param>
        /// <returns></returns>
        public CApplicationMessage ActionCustomerOrder(string pInputValue)
        {
            try
            {
                COutputValue output = new COutputValue();
                CApplicationMessage obj = CallFunction<CApplicationMessage>(CSystemFunction.ActionCustomerOrder, pInputValue);
                return obj;
            }
            catch (Exception ex)
            {
                CLogManager.WriteDAL("GetCustomer", ex.Message);
                return null;
            }
        }
        public CDataTable GetCustomerExport(string pInputValue)
        {
            try
            {
                COutputValue output = new COutputValue();
                CDataTable obj = CallFunctionWithDataTable(CSystemFunction.GetCustomerExport, pInputValue);
                return obj;
            }
            catch (Exception ex)
            {
                CLogManager.WriteDAL("GetProjectResponseExport", ex.Message);
                return null;
            }
        }
    }
}